package cn.nsu.douban.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.nsu.douban.dao.dao.IPingFenDao;
import cn.nsu.douban.entity.EvaluationInfo;
import cn.nsu.douban.entity.MovieInfo;
import cn.nsu.douban.service.IPingFenService;

@Service
@Transactional
public class IPingFenServiceImpl implements IPingFenService {

	@Resource
	 private  IPingFenDao  iPingFenDao;

	@Override
	public void insertPingFen(EvaluationInfo emInfo) {
 		  iPingFenDao.insertEmInfoByUserIdAndMoId(emInfo);
	}

	@Override
	public List<EvaluationInfo> getNowPingFen(MovieInfo movieInfo) {
		return iPingFenDao.getPingFen(movieInfo);
	}

	@Override
	public Integer getPingFenCount(MovieInfo movieInfo) {
		return iPingFenDao.getPingFenCount(movieInfo);
	}
}
